package cn.zyjblogs.starter.sms.provider;

import cn.zyjblogs.starter.sms.common.SmsEnum;
import cn.zyjblogs.starter.sms.common.SmsRequest;
import cn.zyjblogs.starter.sms.common.SmsResponse;

import java.util.List;

/**
 *
 * @author zhuyijun
 */
public abstract class AbstractSmsGranter implements SmsGranter {
    private final SmsEnum typeName;

    public AbstractSmsGranter(SmsEnum typeName) {
        this.typeName = typeName;
    }

    @Override
    public SmsGranter getGranter(SmsEnum typeName) {
        return null;
    }

    @Override
    public SmsResponse sendSms(SmsEnum typeName, List<String> phones, SmsRequest smsRequest) {
        return sendSms(phones, smsRequest);
    }

    @Override
    public SmsResponse sendSms(SmsEnum typeName, String phone, SmsRequest smsRequest) {
        return sendSms(phone, smsRequest);
    }

    /**
     * 批量短信发送
     * @param phones
     * @param smsRequest
     * @return
     */
    public abstract SmsResponse sendSms(List<String> phones, SmsRequest smsRequest);

    /**
     * 单个短信发送
     * @param phone
     * @param smsRequest
     * @return
     */
    public abstract SmsResponse sendSms(String phone, SmsRequest smsRequest);
}
